{% if categories %}
    <nav id="menu" class="navbar">
        <div class="container">
            <div class="row no-gutters">
                <div class="side-menu">
                    <ul class="navigation clearfix">
                        <li class="navigation-dropdown">
                            <a href="/">{{ text_index }}</a>
                        </li>
                        {% for category in categories %}
                            {% if category.children %}
                                <li class="navigation-dropdown">
                                    <a href="{{ category.href }}">{{ category.name }}</a>
                                    <div class="navigation-dropdown-panel  {{  loop.first ? 'active' : '' }}">
                                       {#begin: 儿子#}
                                        <div class="children">
                                            <div class="container">
                                                {% for child in category.children %}
                                                    <h4 class="children-name"><a href="{{ child.href }}">{{ child.name }}</a></h4>
                                                    {#beigin: 孙子#}
                                                    <p class="children-grandchild">
                                                        {% for grandchild in child.children %}
                                                            <a href="{{ grandchild.href }}">{{ grandchild.name }}</a>
                                                        {%  endfor %}
                                                    </p>
                                                    {#end: 孙子#}
                                                {% endfor %}
                                            </div>
                                        </div>
                                        {#end: 孙子#}
                                    </div>
                                </li>
                            {% else %}
                                <li class="navigation-dropdown"><a href="{{ category.href }}">{{ category.name }}</a></li>
                            {% endif %}
                        {% endfor %}
                    </ul>
                </div>
            </div>
        </div>
    </nav>
{% endif %}

